<mat-form-field class="example-user-input">
  <mat-label>Tooltip position</mat-label>
  <mat-select [formControl]="position">
    @for (positionOption of positionOptions; track positionOption) {
      <mat-option [value]="positionOption">{{positionOption}}</mat-option>
    }
  </mat-select>
</mat-form-field>

<button matButton="elevated"
        matTooltip="Info about the action"
        [matTooltipPosition]="position.value!"
        aria-label="Button that displays a tooltip in various positions">
  Action
</button>
